﻿using Fadada.FASC.SDK.DotNetCore.Interfaces;
using Fadada.FASC.SDK.DotNetCore.Model;
using System.Collections.Generic;
using System.Threading.Tasks;
using Newtonsoft.Json;

namespace Fadada.FASC.SDK.DotNetCore.Services
{
    public class SignTemplateGetListService : ISignTemplateGetListService
    {

        public async Task<ResponseBodyInfo<RespSignTemplateListInfo>> GetSignTemplateListAsync(SignTemplateList signTemplateList, BaseInputInfo inputInfo, string token)
        {
            var reqStr = JsonConvert.SerializeObject(signTemplateList, new JsonSerializerSettings() { NullValueHandling = NullValueHandling.Ignore });
            var body = new Dictionary<string, string>() { { "bizContent", reqStr } };
            IGetFromBodyService service = new GetFromBodyService();
            string result = await service.GetFromHttpBodyAsync(inputInfo, body, token);
            return JsonConvert.DeserializeObject<ResponseBodyInfo<RespSignTemplateListInfo>>(result);
        }
    }
}